<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
	<%@ include file="../../include/head.jsp"%>
	<%@ include file="../../include/layui.jsp"%>
	<title>编辑用户扩展信息</title>
</head>
<body>
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-body">
			<form class="layui-form" action="">
				
				<input type="hidden" id="userId" name="userId" value="${userData.userId}">
				<div class="layui-form-item">
					<label class="layui-form-label">国家ID</label>
					<div class="layui-input-block">
						<input type="text" id="nationalityId" name="nationalityId" lay-verify="nationalityId" value="${userData.nationalityId}" autocomplete="off" placeholder="请输入国家ID" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">省份ID</label>
					<div class="layui-input-block">
						<input type="text" id="provinceId" name="provinceId" lay-verify="provinceId" value="${userData.provinceId}" autocomplete="off" placeholder="请输入省份ID" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">城市ID</label>
					<div class="layui-input-block">
						<input type="text" id="cityId" name="cityId" lay-verify="cityId" value="${userData.cityId}" autocomplete="off" placeholder="请输入城市ID" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">创建人</label>
					<div class="layui-input-block">
						<input type="text" id="creater" name="creater" lay-verify="creater" value="${userData.creater}" autocomplete="off" placeholder="请输入创建人" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">修改人</label>
					<div class="layui-input-block">
						<input type="text" id="modifier" name="modifier" lay-verify="modifier" value="${userData.modifier}" autocomplete="off" placeholder="请输入修改人" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-block">
						<input type="text" id="reorder" name="reorder" lay-verify="reorder" value="${userData.reorder}" autocomplete="off" placeholder="请输入排序" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">描述</label>
					<div class="layui-input-block">
						<input type="text" id="remark" name="remark" lay-verify="remark" value="${userData.remark}" autocomplete="off" placeholder="请输入描述" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="channelId" name="channelId" lay-verify="channelId" value="${userData.channelId}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="channelIdOld" name="channelIdOld" lay-verify="channelIdOld" value="${userData.channelIdOld}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="baiduUserId" name="baiduUserId" lay-verify="baiduUserId" value="${userData.baiduUserId}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="baiduUserIdOld" name="baiduUserIdOld" lay-verify="baiduUserIdOld" value="${userData.baiduUserIdOld}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">会员邮箱</label>
					<div class="layui-input-block">
						<input type="text" id="userEmail" name="userEmail" lay-verify="userEmail" value="${userData.userEmail}" autocomplete="off" placeholder="请输入会员邮箱" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="macId" name="macId" lay-verify="macId" value="${userData.macId}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">记录手机的IMEI码</label>
					<div class="layui-input-block">
						<input type="text" id="imei" name="imei" lay-verify="imei" value="${userData.imei}" autocomplete="off" placeholder="请输入记录手机的IMEI码" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="deviceToken" name="deviceToken" lay-verify="deviceToken" value="${userData.deviceToken}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="imageUrl" name="imageUrl" lay-verify="imageUrl" value="${userData.imageUrl}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="nickName" name="nickName" lay-verify="nickName" value="${userData.nickName}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">可抽奖次数</label>
					<div class="layui-input-block">
						<input type="text" id="lotteryCount" name="lotteryCount" lay-verify="lotteryCount" value="${userData.lotteryCount}" autocomplete="off" placeholder="请输入可抽奖次数" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">开户人姓名</label>
					<div class="layui-input-block">
						<input type="text" id="bankUsername" name="bankUsername" lay-verify="bankUsername" value="${userData.bankUsername}" autocomplete="off" placeholder="请输入开户人姓名" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">银行卡号</label>
					<div class="layui-input-block">
						<input type="text" id="bankCard" name="bankCard" lay-verify="bankCard" value="${userData.bankCard}" autocomplete="off" placeholder="请输入银行卡号" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">银行名称</label>
					<div class="layui-input-block">
						<input type="text" id="bankName" name="bankName" lay-verify="bankName" value="${userData.bankName}" autocomplete="off" placeholder="请输入银行名称" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">联系电话</label>
					<div class="layui-input-block">
						<input type="text" id="contactPhone" name="contactPhone" lay-verify="contactPhone" value="${userData.contactPhone}" autocomplete="off" placeholder="请输入联系电话" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">安全口令</label>
					<div class="layui-input-block">
						<input type="text" id="securePwd" name="securePwd" lay-verify="securePwd" value="${userData.securePwd}" autocomplete="off" placeholder="请输入安全口令" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">给邀请人奖励抽奖次数</label>
					<div class="layui-input-block">
						<input type="text" id="invitAwardLottery" name="invitAwardLottery" lay-verify="invitAwardLottery" value="${userData.invitAwardLottery}" autocomplete="off" placeholder="请输入给邀请人奖励抽奖次数" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="systemLotteryCount" name="systemLotteryCount" lay-verify="systemLotteryCount" value="${userData.systemLotteryCount}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="isClickHome" name="isClickHome" lay-verify="isClickHome" value="${userData.isClickHome}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">1男2女</label>
					<div class="layui-input-block">
						<input type="text" id="sex" name="sex" lay-verify="sex" value="${userData.sex}" autocomplete="off" placeholder="请输入1男2女" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">生日</label>
					<div class="layui-input-block">
						<input type="text" id="birthday" name="birthday" lay-verify="birthday" value="${userData.birthday}" autocomplete="off" placeholder="请输入生日" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">所在地</label>
					<div class="layui-input-block">
						<input type="text" id="userLocation" name="userLocation" lay-verify="userLocation" value="${userData.userLocation}" autocomplete="off" placeholder="请输入所在地" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">职业</label>
					<div class="layui-input-block">
						<input type="text" id="userOccupation" name="userOccupation" lay-verify="userOccupation" value="${userData.userOccupation}" autocomplete="off" placeholder="请输入职业" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">学历</label>
					<div class="layui-input-block">
						<input type="text" id="qualifications" name="qualifications" lay-verify="qualifications" value="${userData.qualifications}" autocomplete="off" placeholder="请输入学历" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">区县id</label>
					<div class="layui-input-block">
						<input type="text" id="countyId" name="countyId" lay-verify="countyId" value="${userData.countyId}" autocomplete="off" placeholder="请输入区县id" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">svip退款安全口令错误次数</label>
					<div class="layui-input-block">
						<input type="text" id="secureFaultCount" name="secureFaultCount" lay-verify="secureFaultCount" value="${userData.secureFaultCount}" autocomplete="off" placeholder="请输入svip退款安全口令错误次数" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">用户手机唯一标识</label>
					<div class="layui-input-block">
						<input type="text" id="padUnique" name="padUnique" lay-verify="padUnique" value="${userData.padUnique}" autocomplete="off" placeholder="请输入用户手机唯一标识" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">邀请码，用于国庆邀请活动</label>
					<div class="layui-input-block">
						<input type="text" id="inviteCode" name="inviteCode" lay-verify="inviteCode" value="${userData.inviteCode}" autocomplete="off" placeholder="请输入邀请码，用于国庆邀请活动" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">累积登陆天数</label>
					<div class="layui-input-block">
						<input type="text" id="loginDays" name="loginDays" lay-verify="loginDays" value="${userData.loginDays}" autocomplete="off" placeholder="请输入累积登陆天数" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">cuid</label>
					<div class="layui-input-block">
						<input type="text" id="cuid" name="cuid" lay-verify="cuid" value="${userData.cuid}" autocomplete="off" placeholder="请输入cuid" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<div class="layui-input-block">
						<input type="text" id="secureFaultCount2" name="secureFaultCount2" lay-verify="secureFaultCount2" value="${userData.secureFaultCount2}" autocomplete="off" placeholder="请输入" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">svip退款安全口令错误次数</label>
					<div class="layui-input-block">
						<input type="text" id="secureFaultCount3" name="secureFaultCount3" lay-verify="secureFaultCount3" value="${userData.secureFaultCount3}" autocomplete="off" placeholder="请输入svip退款安全口令错误次数" class="layui-input" >
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button type="button" class="layui-btn" lay-submit  lay-filter="userDataSubmit" id="submitBtn">提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript">
    layui.use(['form', 'layer', 'laydate'], function(){
        var laydate = layui.laydate;
        

        // 校验初始化
        var form = layui.form;
        form.verify({
            
			nationalityId: function(value, item){
				if(value > 2147483647){
					return '国家ID必须是2147483647以内的正整数'
				}
			}
			,provinceId: function(value, item){
				if(value > 2147483647){
					return '省份ID必须是2147483647以内的正整数'
				}
			}
			,cityId: function(value, item){
				if(value > 2147483647){
					return '城市ID必须是2147483647以内的正整数'
				}
			}
			,creater: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '创建人不能超过50位'
				}
			}
			,modifier: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '修改人不能超过50位'
				}
			}
			,reorder: function(value, item){
				if(value > 2147483647){
					return '排序必须是2147483647以内的正整数'
				}
			}
			,remark: function(value, item){
				if(!/^.{0,500}$/.test(value)){
					return '描述不能超过500位'
				}
			}
			,channelId: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '不能超过50位'
				}
			}
			,channelIdOld: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '不能超过50位'
				}
			}
			,baiduUserId: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '不能超过50位'
				}
			}
			,baiduUserIdOld: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '不能超过50位'
				}
			}
			,userEmail: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '会员邮箱不能超过50位'
				}
			}
			,macId: function(value, item){
				if(!/^.{0,32}$/.test(value)){
					return '不能超过32位'
				}
			}
			,imei: function(value, item){
				if(!/^.{0,255}$/.test(value)){
					return '记录手机的IMEI码不能超过255位'
				}
			}
			,deviceToken: function(value, item){
				if(!/^.{0,100}$/.test(value)){
					return '不能超过100位'
				}
			}
			,imageUrl: function(value, item){
				if(!/^.{0,500}$/.test(value)){
					return '不能超过500位'
				}
			}
			,nickName: function(value, item){
				if(!/^.{0,500}$/.test(value)){
					return '不能超过500位'
				}
			}
			,lotteryCount: function(value, item){
				if(value > 2147483647){
					return '可抽奖次数必须是2147483647以内的正整数'
				}
			}
			,bankUsername: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '开户人姓名不能超过50位'
				}
			}
			,bankCard: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '银行卡号不能超过50位'
				}
			}
			,bankName: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '银行名称不能超过50位'
				}
			}
			,contactPhone: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '联系电话不能超过50位'
				}
			}
			,securePwd: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '安全口令不能超过50位'
				}
			}
			,invitAwardLottery: function(value, item){
				if(value > 2147483647){
					return '给邀请人奖励抽奖次数必须是2147483647以内的正整数'
				}
			}
			,systemLotteryCount: function(value, item){
				if(value > 2147483647){
					return '必须是2147483647以内的正整数'
				}
			}
			,isClickHome: function(value, item){
				if(!/^.{0,1}$/.test(value)){
					return '不能超过1位'
				}
			}
			,sex: function(value, item){
				if(!/^.{0,1}$/.test(value)){
					return '1男2女不能超过1位'
				}
			}
			,birthday: function(value, item){
				if(!/^.{0,50}$/.test(value)){
					return '生日不能超过50位'
				}
			}
			,userLocation: function(value, item){
				if(!/^.{0,500}$/.test(value)){
					return '所在地不能超过500位'
				}
			}
			,userOccupation: function(value, item){
				if(!/^.{0,100}$/.test(value)){
					return '职业不能超过100位'
				}
			}
			,qualifications: function(value, item){
				if(!/^.{0,100}$/.test(value)){
					return '学历不能超过100位'
				}
			}
			,countyId: function(value, item){
				if(value > 2147483647){
					return '区县id必须是2147483647以内的正整数'
				}
			}
			,secureFaultCount: function(value, item){
				if(value > 2147483647){
					return 'svip退款安全口令错误次数必须是2147483647以内的正整数'
				}
			}
			,padUnique: function(value, item){
				if(!/^.{0,100}$/.test(value)){
					return '用户手机唯一标识不能超过100位'
				}
			}
			,inviteCode: function(value, item){
				if(!/^.{0,8}$/.test(value)){
					return '邀请码，用于国庆邀请活动不能超过8位'
				}
			}
			,loginDays: function(value, item){
				if(value > 2147483647){
					return '累积登陆天数必须是2147483647以内的正整数'
				}
			}
			,cuid: function(value, item){
				if(!/^.{0,64}$/.test(value)){
					return 'cuid不能超过64位'
				}
			}
			,secureFaultCount2: function(value, item){
				if(value > 2147483647){
					return '必须是2147483647以内的正整数'
				}
			}
			,secureFaultCount3: function(value, item){
				if(value > 2147483647){
					return 'svip退款安全口令错误次数必须是2147483647以内的正整数'
				}
			}
        });


        form.on('submit(userDataSubmit)', function(){
            var url = '${ctx}/user/userData/';
            if($('#userId').val()){
                url += 'modify';
            }else{
                url += 'add';
			}
            $.post(url, $('form').serialize(), function(result){
                if(result.code == 0){
                    parent.layer.alert('操作成功', {
                        yes: function(index){
                            parent.layer.close(index);
                            closeCurrentTabsPage();
                        }
                    });
                }else{
                    parent.layer.msg(result.msg || '操作失败');
                }
            }, 'json');
            return false;
        });
    });
</script>
</body>
</html>